import { ref, computed } from 'vue'
import { defineStore } from 'pinia'

export const useUSerStore = defineStore('pinia-user', () => {
  const count = ref(1)
  const doubleCount = computed(() => count.value * 2)
  function increment() {
    count.value++
  }

  return { count, doubleCount, increment }
},
    {
        // 初始化的时候不会持久化,只有值改变的时候才会触发持久化缓存
      persist: true
    })
